if (id.endsWith('.desktop')) {
let app = this._appSys.lookup_app(id);
- metas.push({ 'id': app.get_id(),
- 'name': app.get_name(),
- 'createIcon'(size) {
- return app.create_icon_texture(size);
- }
+ metas.push({
+ id: app.get_id(),
+ name: app.get_name(),
+ createIcon: size => app.create_icon_texture(size),
});
} else {
let name = this._systemActions.getName(id);
let app = Shell.AppSystem.get_default().lookup_app(appId);
- Main.overview.setMessage(_("%s has been added to your favorites.").format(app.get_name()),
- { forFeedback: true,
- undoCallback: () => {
- this._removeFavorite(appId);
- }
- });
+ let msg = _("%s has been added to your favorites.").format(app.get_name());
+ Main.overview.setMessage(msg, {
+ forFeedback: true,
+ undoCallback: () => this._removeFavorite(appId),
+ });
}
addFavorite(appId) {
if (!this._removeFavorite(appId))
return;
- Main.overview.setMessage(_("%s has been removed from your favorites.").format(app.get_name()),
- { forFeedback: true,
- undoCallback: () => {
- this._addFavorite(appId, pos);
- }
- });
+ let msg = _("%s has been removed from your favorites.").format(app.get_name());
+ Main.overview.setMessage(msg, {
+ forFeedback: true,
+ undoCallback: () => this._addFavorite(appId, pos),
+ });
}
}
Signals.addSignalMethods(AppFavorites.prototype);
}
_loadAnimation(file) {
- this._cache.getAnimation({ file: file,
- settingsSchema: this._settings.schema_id,
- onLoaded: animation => {
- this._animation = animation;
-
- if (!this._animation || this._cancellable.is_cancelled()) {
- this._setLoaded();
- return;
- }
+ this._cache.getAnimation({
+ file: file,
+ settingsSchema: this._settings.schema_id,
+ onLoaded: animation => {
+ this._animation = animation;
+
+ if (!this._animation || this._cancellable.is_cancelled()) {
+ this._setLoaded();
+ return;
+ }
- this._updateAnimation();
- this._watchFile(file);
- }
- });
+ this._updateAnimation();
+ this._watchFile(file);
+ }
+ });
}
_loadImage(file) {
_createBackgroundActor() {
let background = this._backgroundSource.getBackground(this._monitorIndex);
- let backgroundActor = new Meta.BackgroundActor({ meta_display: global.display,
- monitor: this._monitorIndex,
- background: background.background,
- vignette: this._vignette,
- vignette_sharpness: 0.5,
- brightness: 0.5,
- });
+ let backgroundActor = new Meta.BackgroundActor({
+ meta_display: global.display,
+ monitor: this._monitorIndex,
+ background: background.background,
+ vignette: this._vignette,
+ vignette_sharpness: 0.5,
+ brightness: 0.5,
+ });
this._container.add_child(backgroundActor);
style_class: 'hotplug-notification-item-icon' });
box.add(icon);
- let label = new St.Bin({ y_align: St.Align.MIDDLE,
- child: new St.Label
- ({ text: _("Open with %s").format(app.get_name()) })
- });
+ let label = new St.Bin({
+ y_align: St.Align.MIDDLE,
+ child: new St.Label({ text: _("Open with %s").format(app.get_name()) }),
+ });
box.add(label);
let button = new St.Button({ child: box,
expand: true });
}
- this._okButton = { label: _("Connect"),
- action: this._onOk.bind(this),
- default: true
- };
-
- this.setButtons([{ label: _("Cancel"),
- action: this.cancel.bind(this),
- key: Clutter.KEY_Escape,
- },
- this._okButton]);
+ this._okButton = {
+ label: _("Connect"),
+ action: this._onOk.bind(this),
+ default: true,
+ };
+
+ this.setButtons([{
+ label: _("Cancel"),
+ action: this.cancel.bind(this),
+ key: Clutter.KEY_Escape,
+ }, this._okButton]);
this._updateOkButton();
}
let shouldAsk = keyfile.get_boolean(groups[i], 'ShouldAsk');
if (shouldAsk) {
- contentOverride.secrets.push({ label: keyfile.get_string(groups[i], 'Label'),
- key: groups[i],
- value: value,
- password: keyfile.get_boolean(groups[i], 'IsSecret')
- });
+ contentOverride.secrets.push({
+ label: keyfile.get_string(groups[i], 'Label'),
+ key: groups[i],
+ value: value,
+ password: keyfile.get_boolean(groups[i], 'IsSecret'),
+ });
} else {
if (!value.length) // Ignore empty secrets
continue;
var NetworkAgent = class {
constructor() {
- this._native = new Shell.NetworkAgent({ identifier: 'org.gnome.Shell.NetworkAgent',
- capabilities: NM.SecretAgentCapabilities.VPN_HINTS,
- auto_register: false
- });
+ this._native = new Shell.NetworkAgent({
+ identifier: 'org.gnome.Shell.NetworkAgent',
+ capabilities: NM.SecretAgentCapabilities.VPN_HINTS,
+ auto_register: false,
+ });
this._dialogs = { };
this._vpnRequests = { };
// Having the ability to go to the current date if the user is already
// on the current date can be confusing. So don't make the button reactive
// until the selected date changes.
- this.actor = new St.Button({ style_class: 'datemenu-today-button',
- x_expand: true, x_align: St.Align.START,
- can_focus: true,
- reactive: false
- });
+ this.actor = new St.Button({
+ style_class: 'datemenu-today-button',
+ x_align: St.Align.START,
+ x_expand: true,
+ can_focus: true,
+ reactive: false,
+ });
this.actor.connect('clicked', () => {
this._calendar.setDate(new Date(), false);
});
for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
let signal = dialogContent.confirmButtons[i].signal;
let label = dialogContent.confirmButtons[i].label;
- buttons.push({ action: () => {
- this.close(true);
- let signalId = this.connect('closed', () => {
- this.disconnect(signalId);
- this._confirm(signal);
- });
- },
- label: label });
+ buttons.push({
+ action: () => {
+ this.close(true);
+ let signalId = this.connect('closed', () => {
+ this.disconnect(signalId);
+ this._confirm(signal);
+ });
+ },
+ label: label,
+ });
}
this.setButtons(buttons);
this._info = info;
this._invocation = invocation;
- this.setButtons([{ label: _("Cancel"),
- action: this._onCancelButtonPressed.bind(this),
- key: Clutter.Escape
- },
- { label: _("Install"),
- action: this._onInstallButtonPressed.bind(this),
- default: true
- }]);
+ this.setButtons([{
+ label: _("Cancel"),
+ action: this._onCancelButtonPressed.bind(this),
+ key: Clutter.Escape,
+ }, {
+ label: _("Install"),
+ action: this._onInstallButtonPressed.bind(this),
+ default: true,
+ }]);
let content = new Dialog.MessageDialogContent({
title: _("Download and install “%s” from extensions.gnome.org?").format(info.name),
reactive: true });
this.addChrome(this.overviewGroup);
- this.screenShieldGroup = new St.Widget({ name: 'screenShieldGroup',
- visible: false,
- clip_to_allocation: true,
- layout_manager: new Clutter.BinLayout(),
- });
+ this.screenShieldGroup = new St.Widget({
+ name: 'screenShieldGroup',
+ visible: false,
+ clip_to_allocation: true,
+ layout_manager: new Clutter.BinLayout(),
+ });
this.addChrome(this.screenShieldGroup);
this.panelBox = new St.BoxLayout({ name: 'panelBox',
*/
var Lightbox = class Lightbox {
constructor(container, params) {
- params = Params.parse(params, { inhibitEvents: false,
- width: null,
- height: null,
- fadeFactor: DEFAULT_FADE_FACTOR,
- radialEffect: false,
- });
+ params = Params.parse(params, {
+ inhibitEvents: false,
+ width: null,
+ height: null,
+ fadeFactor: DEFAULT_FADE_FACTOR,
+ radialEffect: false,
+ });
this._container = container;
this._children = container.get_children();
// A notification without a policy object will inherit the default one.
var NotificationPolicy = class NotificationPolicy {
constructor(params) {
- params = Params.parse(params, { enable: true,
- enableSound: true,
- showBanners: true,
- forceExpanded: false,
- showInLockScreen: true,
- detailsInLockScreen: false
- });
+ params = Params.parse(params, {
+ enable: true,
+ enableSound: true,
+ showBanners: true,
+ forceExpanded: false,
+ showInLockScreen: true,
+ detailsInLockScreen: false,
+ });
Object.getOwnPropertyNames(params).forEach(key => {
let desc = Object.getOwnPropertyDescriptor(params, key);
Object.defineProperty(this, `_${key}`, desc);
}
setMessage(text, options) {
- options = Params.parse(options, { undoCallback: null,
- forFeedback: false
- });
+ options = Params.parse(options, {
+ undoCallback: null,
+ forFeedback: false,
+ });
let undoCallback = options.undoCallback;
let forFeedback = options.forFeedback;
}
}, class PopupBaseMenuItem extends St.BoxLayout {
_init(params) {
- params = Params.parse (params, { reactive: true,
- activate: true,
- hover: true,
- style_class: null,
- can_focus: true
- });
+ params = Params.parse (params, {
+ reactive: true,
+ activate: true,
+ hover: true,
+ style_class: null,
+ can_focus: true,
+ });
super._init({ style_class: 'popup-menu-item',
reactive: params.reactive,
track_hover: params.reactive,
this._statusBin = new St.Bin({ x_align: St.Align.END });
this.add(this._statusBin, { expand: true, x_align: St.Align.END });
- this._statusLabel = new St.Label({ text: '',
- style_class: 'popup-status-menu-item'
- });
+ this._statusLabel = new St.Label({
+ text: '',
+ style_class: 'popup-status-menu-item',
+ });
this._statusBin.child = this._switch;
}
this._errorBox.hide();
- this.setButtons([{ action: this.close.bind(this),
- label: _("Close"),
- key: Clutter.Escape }]);
+ this.setButtons([{
+ action: this.close.bind(this),
+ label: _("Close"),
+ key: Clutter.Escape,
+ }]);
this._pathCompleter = new Gio.FilenameCompleter();
this.actor = Main.layoutManager.screenShieldGroup;
this._lockScreenState = MessageTray.State.HIDDEN;
- this._lockScreenGroup = new St.Widget({ x_expand: true,
- y_expand: true,
- reactive: true,
- can_focus: true,
- name: 'lockScreenGroup',
- visible: false,
- });
+ this._lockScreenGroup = new St.Widget({
+ x_expand: true,
+ y_expand: true,
+ reactive: true,
+ can_focus: true,
+ name: 'lockScreenGroup',
+ visible: false,
+ });
this._lockScreenGroup.connect('key-press-event',
this._onLockScreenKeyPress.bind(this));
this._lockScreenGroup.connect('scroll-event',
for (let idx = 0; idx < choices.length; idx++) {
let button = idx;
- buttons.unshift({ label: choices[idx],
- action: () => dialog.emit('response', button)
- });
+ buttons.unshift({
+ label: choices[idx],
+ action: () => dialog.emit('response', button),
+ });
}
dialog.setButtons(buttons);
this._rememberChoice = null;
}
- this._defaultButtons = [{ label: _("Cancel"),
- action: this._onCancelButton.bind(this),
- key: Clutter.Escape
- },
- { label: _("Unlock"),
- action: this._onUnlockButton.bind(this),
- default: true
- }];
-
- this._usesKeyfilesButtons = [{ label: _("Cancel"),
- action: this._onCancelButton.bind(this),
- key: Clutter.Escape
- },
- { /* Translators: %s is the Disks application */
- label: _("Open %s").format(disksApp.get_name()),
- action: this._onOpenDisksButton.bind(this),
- default: true
- }];
+ this._defaultButtons = [{
+ label: _("Cancel"),
+ action: this._onCancelButton.bind(this),
+ key: Clutter.Escape,
+ }, {
+ label: _("Unlock"),
+ action: this._onUnlockButton.bind(this),
+ default: true,
+ }];
+
+ this._usesKeyfilesButtons = [{
+ label: _("Cancel"),
+ action: this._onCancelButton.bind(this),
+ key: Clutter.Escape,
+ }, {
+ /* Translators: %s is the Disks application */
+ label: _("Open %s").format(disksApp.get_name()),
+ action: this._onOpenDisksButton.bind(this),
+ default: true,
+ }];
this.setButtons(this._defaultButtons);
}
this._resortItems();
} else {
- network = { ssid: accessPoint.get_ssid(),
- mode: accessPoint.mode,
- security: this._getApSecurityType(accessPoint),
- connections: [],
- item: null,
- accessPoints: [accessPoint]
- };
+ network = {
+ ssid: accessPoint.get_ssid(),
+ mode: accessPoint.mode,
+ security: this._getApSecurityType(accessPoint),
+ connections: [],
+ item: null,
+ accessPoints: [accessPoint],
+ };
network.ssidText = ssidToLabel(network.ssid);
this._checkConnections(network, accessPoint);
if (params.a11yFocus)
Main.ctrlAltTabManager.addGroup(params.a11yFocus, name, a11yIcon);
else
- Main.ctrlAltTabManager.addGroup(actor, name, a11yIcon,
- { proxy: this.actor,
- focusCallback: () => {
- this._a11yFocusPage(page);
- }
- });
+ Main.ctrlAltTabManager.addGroup(actor, name, a11yIcon, {
+ proxy: this.actor,
+ focusCallback: () => this._a11yFocusPage(page),
+ });
page.hide();
this.actor.add_actor(page);
return page;